package com.alibaba.datax.elasticresource.handler;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import org.apache.curator.shaded.com.google.common.collect.Lists;
import org.apache.flink.api.common.time.Time;
import org.apache.flink.runtime.rest.handler.AbstractRestHandler;
import org.apache.flink.runtime.rest.handler.HandlerRequest;
import org.apache.flink.runtime.rest.handler.RestHandlerException;
import org.apache.flink.runtime.rest.messages.EmptyMessageParameters;
import org.apache.flink.runtime.rest.messages.EmptyRequestBody;
import org.apache.flink.runtime.rest.messages.LogInfo;
import org.apache.flink.runtime.rest.messages.LogListInfo;
import org.apache.flink.runtime.rest.messages.MessageHeaders;
import org.apache.flink.runtime.rpc.retriever.GatewayRetriever;
import org.apache.flink.runtime.webmonitor.RestfulGateway;
import org.apache.flink.util.concurrent.FutureUtils;

import com.alibaba.datax.core.statistics.SummaryStatistics;
import com.leehom.arch.datax.report.core.model.ReportLog;

/**
 * @类名: DataxReportHandler
 * @说明: datax报告rest处理器，处理报告查询请求
 *
 * @author   leehom
 * @Date	 2024年8月26日 下午12:10:18
 * 修改记录：
 *
 * @see 	 
 */
public class DataxReportHandler
        extends AbstractRestHandler<
                RestfulGateway, EmptyRequestBody, DataxStatisticsReportResult, EmptyMessageParameters> {
	
	// SearchApi

    public DataxReportHandler(
            GatewayRetriever<? extends RestfulGateway> leaderRetriever,
            Time timeout,
            Map<String, String> responseHeaders,
            MessageHeaders<EmptyRequestBody, DataxStatisticsReportResult, EmptyMessageParameters> messageHeaders,
            @Nullable File logDir) {
        super(leaderRetriever, timeout, responseHeaders, messageHeaders);

    }

    @Override
    protected CompletableFuture<DataxStatisticsReportResult> handleRequest(
            @Nonnull HandlerRequest<EmptyRequestBody> request, @Nonnull RestfulGateway gateway)
            throws RestHandlerException {
        return CompletableFuture.completedFuture(new DataxStatisticsReportResult(Lists.newArrayList()));
    }
    
    // 构建搜索表达式，过滤表达式
}
